Better refactoring, addet new functions to statespaceParser