Moved create context to separate file