Feature/function partitioning

I think this could be clearer