End of refacto (i hope)