Refactoring compute