data-binding: improved tests and refactoring