Make filename in the initializer optional

 since it is not used in all instance methods
General code cleanup