refactor picasa code