clean up types, implement 'anchorStart', 'anchorEnd', and 'spell'