Refactored class structure. Added global configuration