refactoring: moved parsing into seperate file