Refactoring + add json package