Condensed the two public functions getCreatedAtAttribute and getUpdatedAtAttribute into on private function to minimize repeatitive code.