cleaned up path rendering code