refactor pass 10 - more reimplementation