Small improvements

Hello. I've made some code improvements largely for better readability.