Introduced function interface.
Refactoring, removed classes. Using anonymous classes instead.