move and create some useful code snippets