make code more readable and consistent

adding convenience typedefs, use more verbose and consistent variable
names