replace cache synchronization with lock; clean-up
clean-up and fix other comparator error