Use atom_to_binary/2
Remove unused warning
Fix tha place of internal functions