Code readability and fixes