improvements and abstraction