work in progress in separating logic