finish cop and refactor