A method of optimizing a radiotherapy treatment plan is disclosed, comprising the steps ofa. Obtaining a deliverable input treatment plan,b. Optimizing the deliverable input treatment plan to obtain an optimized treatment plan, using an objective function and at least one constraint, whereini. the objective function is related to reducing the plan complexity in terms of minimizing the machine output (MU) and/or minimizing the time required to deliver the plan and/or maximizing the segment area, and/or minimizing jaggedness of the MLC shapes,ii. To ensure that the quality is maintained, the at least one constraint is based on the dose distribution of the input plan, related to maintaining an acceptable dose distribution.