refactored like functionality