moving towards removing repeated code