Refactor schedule metadata update in simple db