more boiler plate

+ option output to file
+ minor code clean up