a little bit of refactoring
interactive mode. fixes #3