REFACTOR: Better reuse of code