Improve the layouts functions

though this is really not that much effort: