Task preview fix

Styling needs fixing.
any need for all those ifs?
also some unittest for this service would be nice