mod: code refactor, server separated into modules