avoid repeated calculation