Integrate changes based on feedback from @bassosimone