refactoring -> available height/width
refactoring