small refactoringh, prepare for integration with parser, WIP