Created abstract class for gameobjects, refactored code.