split into different modules

and redesigned