modularized setup,  implemented logging decorator