replace magic constants with constants