removed duplicated code in GameElementFactory