Layout and skins codes refactored