organize files
remove min/max macro, remove unnecessary destructor
replace tab
use shared_ptr