removed duplicated code in GameElement