Adding GSON and refactoring