layout changes and refactored