refac + misc