Added file handler class to better modularize code