Code improvement + minor adjustements.