Improves performance

Improves code and performance, removing unnecessary read file.
[minor] Use a space after `//`