date similarity, bugfixes, refactoring