Refactor math out