Readability and data structure improvements