Refactoring according to yoda API