This file is more like a controller rather than a model itself. Maybe it's better if this was moved somewhere else?