Split core code to another file
Split context package to it's own file