Changed type of parse function return value to a result struct.