Refactoring, added -f flag