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