Refactoring gameobjct