Little refactor to fit a multilayer architecture