Fixes, refactoring.