refuctoring
added comments