Refactoring, rewriting of functions, transitioning to better data structure