[master] Improve code structure