separated map code from main server code