refactor sample editor