Better field implementation, refactor code