I'm only a newbie but I will try to contribute with what I've been taught, and with how I understand it.
The way I've been taught is, if you are overweight, in single engine, you do not follow the published MA, but a procedure turn, or the engine out SID(our company has a customized one for the airfields we fly to).
If you were not overweight, the same customized chart has a temperature limit, if above that temperature, you again do not follow the published MA.
Both cases, acceleration alt and flaps retraction are at 1500 AGL for us.
In any other case we will follow the published MA.
Retraction of flaps will be at the acceleration altitude (final GA altitude).