refactor. fixes.