moved service def around