recall precision counting refactored