Code used throughout HS apps.