STY: Refactoring file checking for future use