refactoring and clean up unused code. renamed things. removed the use of weird time formats.