Code refactoring, added 404 page and return home page