more improvements based on prototype