Moved parsing to own file
Further refactoring