Code igniter refactor