refactoring tilo and tests