Refactoring code style for readonly