Refactoring of functional core