* clean up and refactor some files