Spike log type refactor

refactoring around main() function.