Avoid using attributes to store external classes

Signed-off-by: Michal Čihař <michal@cihar.com>