Refactoring + TS compiler code add.