Refactor
Created a context object. Refactor pending