Replaced directly access to database with the usage of getter method