using virtual method instead of switch/case for rebuild