Simplifying #35 code