Refactored and defined more interfaces.