Cleaned up toolbar buttons code