Replace hard-coded values with computed values

Signed-off-by: Jacky Boen <aqiank@gmail.com>