Added improvements for efficiency