replace "magin numbers" with constants