adding map directive to separate view logic from controller