Refactor web application