refactor console sample code and put it in a test file