rename and better code structure