further code deduplication