Refactoring and added buttons