refactor size getter