refacoring and cleaning up.