refactor console (into submodule)