Removed unnecessary repeat check for KEYUP.
Added EntityFactory class.