Fixes and refactor...