conv implementation moved to cpp file
slightly cleaner code