karolsojko refactoring