Move stuff to controller instead of view