fixed interface creation to be in the correct order
some cleanup work