Prevention and treatment of osteoporosis