Cleaned up controller js