restructured into proper module layout