Refactorring Index Page and Show page