Convert constant to a method and fix test