split and organized code