Refactored IO methods into utility class
Refactored parsing of directives into handler
Removed unused regular expressions