Moved some code around; author escaP everywhere