abstract away percentage calculation