Create modularized freeing functions for assets

Signed-off-by: Alberto Corona <albcoron@gmail.com>