Refactor robot name assignment func, and tests to prove it