misc. cleanup / refactor