add/clean up logging and state logic
add debugging
add formatter and console logger