minor refactoring
minor refactoring
reordering functions in file
formatting