Implemented logic to work with structure of table