refactors buttons