moved common code to common