Moved security funcs into package