move common code to seperate file