Revert "Rework last wrong commit"

This reverts commit b2ba16ce358e89411513d6150fa9ba3e81835daa.
Revert "move necessary classes into lib directory"

This reverts commit 25f2d4a67de128d6d0e6c6da4d705d1cc1fcd72f.