refactor; cleanup