use macros and stop leaking