remove undefinde? from API
move some units into their deftest to avoid leaks