Added xline point constructor and new line factory method
Code cleanup
Added element null check