extracted functions