added test, refactor convert from to functions