New configurable server cleanup

Thanks @AgentRev fot the inspiration/idea :)