Did some more improvements in code