Code cleanup as suggested by JLan