peek command, general refactoring