Code duplication removed