make function more concise
make private