Move constants to factory class and update readme with example