trying to reduce code