Revert "changing to a functional approach"

This reverts commit ab8fb58fb2c4f7e7a45c65391aa5b9cbfb52d095.
Was intended to be a personal branch, sorry.