Simulate atom_to_list/1 & Refactor code, tests