partial security refactor, further work
adding enumerations