removed duplicated code from game elements class