Subtract test and refactor