code style improvements, consistency, and cleanup