Little refactoring for component_spec