Refactored register_computer function