fix contraption spawning hooks erroring, refactor a bit