collect some useful code