make static resources relative
compactify a bit