Revert "split code into class, add default filename"

This reverts commit 69f522c21d5d0eda3f18439bc1e663c4b4138270.