refactoring addfeaturestosecurity script