Reorganize code, can define decorators which extend function attributes