Cleaning up the hashmaps and adding traps