code refactoring queue example