refactoring some components, adding proper comments