Adapted to foreman 1.3, and some cleanup