Minor fixes and remove unnecessary object creation