added an attempt at component-based architecture