refactored users_table with activerecord