Refactor code and ad funtionaliyy read keys from NET