Refactor Controller to ruby style