Refactor + fix handling of non-syntactic R names