start refactoring input layer for an easy to understand mapping of input bytes to events