better code for building