added action handlers and layout management
added action handlers and layout management