split functions related to 'write' procedure into files
reordering functions
use shorter name for library external representation