Assets refactoring

Do not merge. Pending code review.