Refactored and added component generation