refactoring
clear head <=> tail misconception