misc. refactor