finished markup parsing, refactored
more refactoring