Refactor and tests

Implemented IT as the main element.