Moved fuctionality away from the views, added som styling