Web front end refactoring code sample