Refactored the top frame controller