BET-64 Fixing tests + refactoring