Move code into show view