Cleaned up controller