Doing it this way is less code duplication

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>