some code enhancements