reduce indent. remove DOM manipulate functions.