refactor check and the spec