Refactor webapp resource to make them platform independent