migrate from oo to fp methods