refactored buttons to nested classes