finished to port to current model with still some old code kept and ready to deploy