Refactor to fix bug on Geppetto

Change-Id: I6a7d4be24617106c14aa3bfd50551461781afe3d