Changed structure of database for simplifying a code