more refactoring. an harmless bug in testing/main.cpp

Signed-off-by: Tolga HOŞGÖR <fasdfasdas@gmail.com>