Clean up of layouting code.