Sort out tests
Mark old interfaces to remove in the future
Merge branch 'code-refactoring'