improvement of code structure