DEBUG timestamp more clean
extracted types to typedefs
replaced magic numbers