Move mapper logic to controller
Fix some minor stuff