Big restructuring, creation of Context object with attributes and methods