latest version incl refactoring

please work