Refactored a bit to add a basic button factory.