moved security mapping to a separate file and refactored