Moved JS to controller