fixing a few problems here and there.. also tring to use less resources and perform better cleanups