Code refactoring and separate table viewing