Time to refactor

My last commit failed and I reverted lost of hours of work by accident.
I really need to learn git