Fix wrong expected value
A bit of refactoring