Refactor of getComponent to use createEmptyInstance