Lots of code refactoring, mainly with moving DICT to another module