[ticket/416] Further reduce complexity of constraints_handler

B3P-416