fix warnings
add convenient macros
update backend code