new version (rework)
remove unused code