Revise apps class to S4 and rename to db class