improve code readability and commenting