Refactored functionality and layouts