removed context and refactored