removing obsolete code, use library functions instead