mappings and controllers refactor