changed attributes to enum and did some performance optimazations with database access