refactored code
half way though playing with asset pipe