Move code to common