buttons refactor