refactor constant removal and ruby loading into beluga method