Helper functions implemented.