Code Refactoring and Code Rewriting Techniques When Building a Two-Sided Marketplace

Code Refactoring and Code Rewriting Techniques When Building a Two-Sided Marketplace

Imagine a case in which you’re building a two-sided marketplace. You want who's to evolve the product from the MVP/startup stage to the enterprise level. Obviously, you’ll face a lot of tasks and app development challenges. One of major app development challenges and issues to be solved, is a web/mobile app technology stack. If you plan your product to be used by big names, you’ll need to ensure that the performance is of A-level. In general, there are two development approaches when building a two-sided marketplace app that is stable and robust: change the current technologies to the brand new ones, or improve the existing stack.

"But how how to build an online marketplace of the ‘enterprise’ level? What steps should I walk through?" You might wonder.

This piece is dedicated to all online marketplace app owners who have been between the devil and the deep blue sea for some time already. The decision whether to implement new frameworks and languages or improve the current web/mobile app features list and structure isn’t always a piece of cake. Or, let’s say it’s a piece of a huge cake which is sometimes difficult to bake.

Here we’d like to provide some facts and tips when it’s better to implement/move to the new web or mobile app technology stack or cases when the improvement of what you’ve already got is the only thing needed.

Are your web/mobile app engagement campaigns performant enough?

This would be our starting point, which can help you decide either to implement something new or to improve the current state of the online marketplace app. Apart from determining your product’s phenomenon that makes user retention rates grow up, analyze first what the dark side of your online marketplace business model is or might be and how to increase customer retention even more?

Where the end user can fall behind?

  • Ineffective marketing and/or distribution techniques?

  • Or the very bundle of issues lies in the app’s code?

Take into consideration that the most prominent peculiarity of all successful online projects is that they’re never static. Just look at how frequent Google, Facebook, AirBnb, Amazon and the list goes on, expand their web/ mobile app features list or change less effective stack with more performant technologies. Some of the companies rewrite server or client side completely and some are simply enhancing their current stack.

There’s no clear border when to apply any of the actions, since the process of improvement simply depends on the app or on the business model to create your own marketplace. Let’s consider typical situations when you’d need code refactoring

Reliable code refactoring techniques as a part of improving online marketplace app's existing functionality

Our recommendation is to use code refactoring in typical dev’s workflow to create your own marketplace that is stable. It doesn’t mean that you should do it on a regular, almost daily basis. Check the readability and quality of the code at least once a month or several months, given the fact of constantly emerging new standards and alterations in the world of programming.

Often, there are also cases when code refactoring turns to the process of a complete product rewriting to more modern web or mobile app technology stack. It usually happens, when one issue that is caused by incorrect use of the current technologies can transform into multiple small-to-critical bugs in the online marketplace app’s architecture. It’s obvious that such ‘domino effect’ is a result of a previously written complicated and non-optimized code.

To avoid this, follow these effective code refactoring techniques:
  1. Try to avoid code duplication when you’re working on a layout for the online marketplace app. If there’re components that reprise from time to time, we can create a separate function that generates a particular component with different values inside. It would be even better if we create a ‘utils’ folder (or something similar to it) that contains a set of universal functions and can be used throughout the entire process of building a two-sided marketplace.


  1. Avoid long (complex) conditional checks, if possible, and place them in separate functions



  1. Readability. The machine will understand any valid code. A person will understand only what is written using the correct variables and functions names. Therefore, it is recommended to name variables using a noun, i.e. projectsCount, or isAuthorized. As for functions, you can use the verbal method of naming, like getProjectsCount, setActiveUser.


  2. Single Responsibility Principle. Each function has to execute one thing, and execute it well. Avoid writing complicated universal functions, which perform different operations or return completely different results depending on the arguments (or any other factor).

The emergence of such efficient JS frameworks and technologies as NodeJS, VueJS, React Native has proved that building a two-sided marketplace with such functionality, like chat, files sending/uploading, real-time mode support, etc. can work faster and more stable. That’s why some companies choose either to merge their existing stack with the new frameworks or refactor/rewrite a certain feature with the framework they’ve decided will fit their product the most. At the same time, this is product owners’ solution on how to increase customer retention rates challenge.

What was that ‘fit their product the most’ part about?

The decision to use this or that framework or language doesn’t come spontaneously. There’s a range of important factors to have on mind when performing not only refactoring but also implementation of the updated web or mobile app technology stack.

How to build an online marketplace of the enterprise level? For this, you’ll need to do the following scope of tasks:

  • Look for the experts in the technology or train your devs team.

  • Count and digest the benefits the implementation of a current technology can bring you. How will it reflect on our revenue?

  • Analyze and compare the performance and usability of the new technology or code refactoring with the previous samples.

When refactoring doesn’t help...

Code refactoring techniques mentioned above might not help, when your product is based on a really obsolete and not updated stack that slows down the workflow of entire online marketplace app.

  • 40% of people abandon a website that takes more than 3 seconds to load (Source: Kissmetrics ). We’re pretty sure, that for the app speed rates this fact is almost exactly the same.

To avoid churns or any other ways of your customers escape, there’re several possible scenarios and web/mobile app engagement campaigns to apply:

  • Replace the entire or part of the stack with the newer technologies that would speed up the performance. Trust this task to the reliable hands only.

  • Introduce a supplementary or completely new feature for users that makes even more of your two-sided marketplace app (i.e. there's a marketplace app which offers its users to browse the menus of various cafes and restaurants in their city. As an app owner, you can include here a brand new feature which helps your customers see food ingredients of any meal served in this or that cafe/restaurant. This way, you'll expand the popularity of your product)

  • Keep to the modern and intuitive in use UI/UX

  • Plan a new marketing activity or set of such activities, which you consider suit your product (influencer marketing, outbound/inbound marketing, SMM, partnership agreements, showcasing your product on conferences etc.)

Remember that sometimes you need to follow the trends but there are also cases when you have to stick to the tradition.

Read a case study on how LinkedIn has implemented Node JS into their stack that made the app’s performance 20x faster.

Proofread and test out your code

Quality assurance department should be present throughout the entire process of refactoring or moving to the new web/mobile app technology stack. Before any step applied, QA team will help you to identify and deal with possible risks of any future alteration/s. We find Atlassian QA department's workflow scheme to be useful. We hope that you’ll find it handy too.


Source: Inside Atlassian: the Jira QA process

Let’s summarize everything

So should you replace current or obsolete tech stack or simply use some code refactoring techniques? We hope that this article will help you to make a final decision on the ways to create your own marketplace of the enterprise level.