Modularize

and create web service.