Refactored handler and domain packages.