A lot of refactoring

A lot of names are changed, capcity removed, other minor changes