cleanup and possible performance