Code reduction for defining modules/classes.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>