Added generic packet interface, reworked a bit