Use layout properly: do not repeat calculations.