code improvements for readability