refactor&cleanup