Converted main file into class.
Added logger.