Refactoring to be used from external packages