rails4 refactor