Refactored common functionality to base struct based on review comments.
Bug 1378792