INTERNAL: minor code improvements.