Small enchancements to code