Although increasingly popular, software component techniques still lack suitable formal foundations on top of which rigorous methodologies for the description and analysis of component-based systems could be built. This talk is about my thesis work and aims to contribute in this direction: building on the previous work "components as coalgebras" of L. Barbosa on coalgebraic model of components, we will discuss a heterogeneous calculi for components as coalgebras, which can be used in combining components with different behavior patterns explicitly specified. Furthermore, we introduce component refinement at three different but interrelated levels: behavioural, syntactic, i.e., relative to component interfaces, and architectural. Software architectures are defined through component aggregation. On the other hand, such aggregations, no matter how large and complex they are, can also be dealt with as components themselves, which paves the way to a discipline of hierarchical design. In this context, the major contribution of our work is a semantic characterization of refinement for state-based components, parametric on a strong monad intended to capture components' behavioural patterns, and the introduction of a set of rules for refinement. Moreover, we present some applications of the coalgebraic model of components, including the specification and refinement of components in RSL and the coalgebraic semantics for UML view models.