Agent technology plays an important role in the construction of context-aware AmI environments, providing the means to develop intelligent, proactive, autonomous, and interacting systems, able to adapt their behaviour according to some contextual conditions. However, the development of modular context-aware agents has been a challenge to software engineers, since context-awareness use to have influence in several components of the agent architecture, increasing their complexity and making them difficult to evolve and reuse. In order to improve the modularization and development of context-aware agents for AmI applications, this work proposes the application of aspect-orientation to separate all the issues related to context-awareness inside the agent software architecture. Specifically, our approach focuses on the modularization of context-awareness as aspects for Malaca software agents. The application of aspect-orientation leads to separate in aspects all the agent functions related to context-awareness, such as context acquisition and context-dependent behaviour, improving the internal modularization of context-awareness in the agent architecture and making it able to adapt dynamically to different contexts.