refactored mapData controller into factories and jslint