fixed routing issues; code cleanup;