Some improvements and preparing for link type
Added support for links