Correct use of of !if
Filename is required - detect empty during initialization
Simplify return logic
Fix formatting in method