moved assets code into its own method