multiple improvements and added set_health support