[UPD] #5 use file constructor and cleanup code

close #5