further simplifying code