It looks like these four lines should be extracted into a shared method - they're the same as below.