Added clean refactor of f5 (wip)