More interfaces; move a lot of code around