minor code improvements in core module