Try to fix duplicate code