starting to refactor formula