Refatoring and bug fixing
Merge remote-tracking branch 'origin/Cahue' into Cahue