refactored parsing/framing/matrix into seperate files