Cleanup client code; rework message cache clear interval