Fixing contexts
Code refactoring