code cleanup, moved scan functions to discovery server