Applied changes following mpollack's comments