move all function and constants into Bsdconv class