Less nasty implementation...