removed unused type
add comments and style improvements