migrating formula logic to it's own module