Implementing custom scope