cleanups and minor changes
cleanup and refactoring
bleh
add flash messages. fixes #31