changed class to check file type and startd using private methods and variables