Add required headers + tests + refactoring (STOX-10)