better code structure in models