refactored code structure for better and added .clang-format file

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