Restructure model into module