Code concising and revision

Concise the code and revise it to more
fit the web framework philosophy.