Improve scope handling

Signed-off-by: Fadion Dashi <jonidashi@gmail.com>