better code structure for the system