fixes some stuff, specially for performance