renamed schema class
refactored a bit