Refactoring to be more generic in general usage.