refactoring button setting for unit test