Refactored - partial commit.