Pulling out more common bits into shared files