Refactored ButtonListener so it isn't ugly anymore