Should probably make all these methods synchronized