Refactor controller and model;