Maybe I will refactor this later in another PR