Improves performance

Improves code and performance, removing unnecessary read file.