Code cleanup for ServerActivity