Refactor theme layout and rebuild