refactored
ref 2