cleaned up parse method