Changed a bit the method for a class definition to be able to reuse it for interfaces.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>