Added KDCS to PyCharm. Starting refactoring and optimization.