todo: figure out where logic goes