Refactor findNodeToSnapTo
Use a constructor instead
Remove unnecessary f.'s