made parse method less complex