refactored scope information into a class