refactored console