trying to separate logic and view  a bit