Refactor console proc