cleanup
move match initialization code
move stuff to better suited packages