Added training timer
Added preference change listener
Added on database change listener