much needed memory optimalisations :p