started scoped functionality
added more improvements