Remove duplicate code by using constant