Refactoring to refine portability implementation.