changing layout and refactoring