Move global encoding functions to class file
move custom date functions to class file