split everthing in classes, cleanupm threading...