refactor calculating hours spent and percentages