relative urls fix, code cleanup