Fixed duplication code