Re-write helper functions