Started refactoring parsing, no idea if this will work