refactored rulefile management in console