a few refactoring

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