refactoring button mapping