Refactor conole+tests.