Update maintenance script to use lock (and loading) helpers