Trivial code changes for efficiency and readability