Improved edge creation