Refactored the packets and loginserver packages