Move code out of common