Some code enhancements