Refactor and solution fixes.