Memory consumption improvements