FIX lock exc.finished
OPT restructure code a bit