refactor(minErr): remove duplicated code