Some fix, I think
Clean and Rewrited some code