#242 #260 fix refactoring bug introduced by 55b8140d2c40d899cda69c270a4774c79f432cbf