moved presentation code to view