move some code around to follow interface schema